#ifndef _SUMMARY_STATE_H_
#define _SUMMARY_STATE_H_

#include "ui_state.h"
namespace gameflow
{
class SummaryState : public UIState
{
public:
						SummaryState(camera::FbCamera*	pCamera, const std::string& BasePanel = "", const std::string& ExecuteOnEnter = "",  const std::string& ExecuteOnLeave = "" );
	virtual				~SummaryState();

	/// called when the game flow manager transitions into this game state
	virtual	bool		OnEnter();

	/// called when the game flow manager transitions out of this game state
	virtual	bool		OnExit();

	/// update the game
	virtual	bool		Tick(float dt);

	/// highscore information arrived
	virtual void		UpdateHighscore();
	virtual void		HideHighscore();

	/// stop countdown
	void				StopCountUp();

protected:
	virtual void		OnWon();
	virtual void		OnLost();

	struct				CountNumber
	{
		math::CounterNumber	Value;
		ui::UIWidget*		pWidget;
		bool				IsTime;
		CountNumber()
		{
			pWidget = NULL;
			IsTime = false;
		};

		void		SetVisible(bool b);
	};
	std::vector<CountNumber>		m_Numbers;
	virtual void		AddNumber(ui::UIWidget* pWidget, float Value, float From = 0, bool IsTime = false);
	virtual void		AddNumber(const std::string& WidgetName, float Value, float From = 0, bool IsTime = false);
	virtual void		SetText(const std::string& WidgetName, const std::string& Text);
	virtual void		SetHighscore(int Index, const std::string& Name, const std::string& Location, int Value);
	// constants
	virtual float		NumberTime() const { return 5.0f; };
	virtual int			HighscoreC() const { return 15; };

	// variables
	bool				m_Won;
	unsigned int		m_TickSound;
};


}

#endif //_SUMMARY_STATE_H_